package com.itheima.service.impl;

import com.itheima.dao.BookDao;
import com.itheima.pojo.Book;
import com.itheima.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author 刘全
 * @date 2021/9/15
 */
@Service
@Transactional
public class BookServiceImpl implements BookService {

    @Autowired
    private BookDao bookDao;
    @Override
    public List<Book> getAll() {
        List<Book> books = bookDao.getAll();
        return books;
    }

    @Override
    public void save(Book book) {
        bookDao.save(book);
    }

    @Override
    public void move(int id) {
        bookDao.move(id);
    }

    @Override
    public void set(Book book) {
        bookDao.set(book);
    }

    @Override
    public List<Book> search(String name) {
        List<Book> books = bookDao.search(name);
        return books;
    }
}
